package com.bsj.power.common.def.entity.loginPerson;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bsj.power.common.def.vo.pls.httpVo.HttpLoginPersonVO;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author LiJiaXin
 * @version 1.0.0
 * @description LoginPerson
 * @time 2024/7/11 19:21
 */
@Data
@TableName(value = "tab_login_person")
@NoArgsConstructor
public class LoginPerson {

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 编号
     */
    @TableField("work_code")
    private String workCode;

    /**
     * 登录名
     */
    @TableField("login_id")
    private String loginId;

    /**
     * 密码
     */
    @TableField("password")
    private String password;

    /**
     * 状态: 0试用 1正式 2临时 3试用延期 4解聘 5离职 6退休 7无效
     */
    @TableField("status")
    private String status;

    /**
     * 人员名称
     */
    @TableField("last_name")
    private String lastName;

    /**
     * 性别
     */
    @TableField("sex")
    private String sex;

    /**
     * 邮箱
     */
    @TableField("email")
    private String email;

    /**
     * 办公电话
     */
    @TableField("telephone")
    private String telephone;

    /**
     * 移动电话
     */
    @TableField("mobile")
    private String mobile;

    /**
     * 创建日期
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField("modified")
    private Date modified;

    public LoginPerson(HttpLoginPersonVO httpLoginPersonVO) {
        this.workCode = httpLoginPersonVO.getWorkcode();
        this.loginId = httpLoginPersonVO.getLoginid();
        this.password = httpLoginPersonVO.getPassword();
        this.status = httpLoginPersonVO.getStatus();
        this.lastName = httpLoginPersonVO.getLastname();
        this.sex = httpLoginPersonVO.getSex();
        this.email = httpLoginPersonVO.getEmail();
        this.telephone = httpLoginPersonVO.getTelephone();
        this.mobile = httpLoginPersonVO.getMobile();
    }

}
